import {Button, Descriptions, Modal, TabPane, Tabs} from "@douyinfe/semi-ui";
import {useRef, useState} from "react";
import {IconLarkColor} from "@arco-design/web-react/icon";
import {IconArrowUp, IconFile, IconGallery, IconGlobe, IconMore, IconWrench} from "@douyinfe/semi-icons";
import Cmodal_form from "../../../compents/change_modal/cmodal_form.jsx";

function Schedule_EForm(props) {
    const [visible, setVisible] = useState(false);
    const showDialog = () => {
        setVisible(true);
    };
    const handleOk = () => {
        setVisible(false);
        console.log('Ok button clicked');
    };
    const handleCancel = () => {
        setVisible(false);
        console.log('Cancel button clicked');
    };
    const handleAfterClose = () => {
        console.log('After Close callback executed');
    };
    const dayin = () => {
        console.log(props.info);
    };
    const data = [
        { key: '实际用户数量', value: '1,480,000' },
        {
            key: '7天留存',
            value: (
                <span>
                    98%
                    <IconArrowUp size="small" style={{ color: 'red', marginLeft: '4px' }} />
                </span>
            ),
        },
        { key: '安全等级', value: '3级' },
    ];
    const style = {
        boxShadow: 'var(--semi-shadow-elevated)',
        backgroundColor: 'var(--semi-color-bg-2)',
        borderRadius: '4px',
        padding: '10px',
        marginRight: '20px',
        width: '600px',
    };
    const childRef = useRef();
    const ceshi = ()=>{
        childRef.current.kaishi();
        handleOk()
    }

    return (
        <>
            <IconMore onClick={showDialog} />

            <Modal
                okText={'Sounds great!'}
                style={{width:"30%",height:"54%"}}
                title={<div><IconGallery style={{marginRight:"10px"}} />修改任务信息</div>}
                visible={visible}
                onOk={handleOk}
                afterClose={handleAfterClose} //>=1.16.0
                onCancel={handleCancel}
                closeOnEsc={true}
                footer={
                    <Button type="primary" onClick={ceshi}>
                       提交
                    </Button>
                }
            >
                <Tabs>
                    <TabPane
                        tab={
                            <span>
                    <IconFile />
                    任务信息
                </span>
                        }
                        itemKey="1"
                    >
                        <Cmodal_form ref={childRef} info={props.info} />
                    </TabPane>
                </Tabs>
            </Modal>
        </>
    );
}
export default Schedule_EForm;